package com.myblog.firstjavaproject;
import java.util.Scanner;
public class Main1 {
    public static void main(String [] args){
        Scanner sc = new Scanner(System.in);
        double sum = 0.0;
        for (int i = 1;; i++) {
            long jiechen = 1;
            for (int j = 1; j <= i; j++) {
                jiechen = jiechen * j;
            }
            double k = 1.0 / jiechen;
            if (k <= 1.0E-8) {
                break;
            }
            sum = sum + k;
        }
        System.out.println("值为；" + sum);
    }
}

